package cn.frank.framework.king.domain.vo.page;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 分页对象
 * @author hl
 *
 * @param <T>
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(description = "分页对象")
@Accessors(chain = true)
public class PageData<T> {

	//总条数
	@ApiModelProperty(name = "total",value = "总条数")
	private long total;
	
	//总页数
	@ApiModelProperty(name = "pages",value = "总页数")
	private int pages;
	
	//每页显示条数
	@ApiModelProperty(name = "pageSize",value = "每页显示条数")
	private int pageSize;
	
	//页码数
	@ApiModelProperty(name = "pageNum",value = "页码数")
	private int pageNum=1;
	
	//列表数据
	@ApiModelProperty(name = "data",value = "列表数据")
	private List<T> data;
	
	@JsonProperty("data")
	public  List<T> getData() {
		return this.data;
	}

}
